<template>
  <div class="custom_navbar_list">
    <h1 class="custom_navbar_list_header" v-if="item.title">
      <div class="custom_navbar_list_header_title">{{ item.title }}</div>
      <div class="custom_navbar_list_header_slogan">
        {{ item.slogan }}
      </div>
      <div class="custom_navbar_list_header_more">
        <slot name="navbarHeaderRight" :item="item"></slot>
      </div>
    </h1>
    <div class="custom_navbar_list_content">
      <div
        class="custom_navbar_list_content_item"
        v-for="(sitem, index) in item.data"
        :key="'navbarList_item_' + index"
      >
        <router-link :to="{ name: sitem.router }">
          <img :src="sitem.image" v-lazy="sitem.image" />
          <article>
            <header>
              <h1>{{ sitem.title }}</h1>
            </header>
            <p>{{ sitem.desc }}</p>
          </article>
        </router-link>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "navbarList",
  props: {
    item: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  data() {
    return {};
  },
};
</script>
<style lang="less">
@base: 23.44rem;
.custom_navbar_list {
  background-color: #fff;
  overflow: hidden;
  clear: both;
  h1 {
    &.custom_navbar_list_header {
      font-size: (14 / @base);
      line-height: (14 / @base);
      text-align: left;
      padding: (10 / @base) (10 / @base);
      display: flex;
      height: (15 / @base);
      overflow: hidden;
      margin: (5 / @base) 0 0;
      div {
        width: 10%;
        &.custom_navbar_list_header_title {
          width: 25%;
          line-height: (14 / @base);
          overflow: hidden;
        }
        &.custom_navbar_list_header_slogan {
          width: 65%;
          font-size: (12 / @base);
          line-height: (14 / @base);
          color: #999;
          margin: 0 0 0 (10 / @base);
          font-weight: 400;
        }
        &.custom_navbar_list_header_more {
          font-size: (12 / @base);
          font-weight: 400;
        }
      }
    }
  }
  .custom_navbar_list_content {
    padding: 0 (7.5 / @base);
    .custom_navbar_list_content_item {
      width: 48.5%;
      float: left;
      text-align: left;
      margin: (5 / @base) (2.5 / @base);
      a {
        img {
          width: 100%;
          height: (84 / @base);
          border-radius: (5 / @base);
          background-color: #999;
          overflow: hidden;
        }
        article {
          header {
            h1 {
              font-size: (14 / @base);
              font-weight: 500;
            }
          }
          p {
            font-size: (10 / @base);
            color: #ccc;
          }
        }
      }
    }
  }
}
</style>
